home *** CD-ROM | disk | FTP | other *** search
/ Dream 55 / Amiga_Dream_55.iso / RISCOS / APPS / TEXT / PS / KIT-PS.ZIP / Kit PS / !PSUtils / pl / fixwpps < prev    next >
Text File  |  1997-01-24  |  767b  |  39 lines

  1. @rem = '-*- Perl -*-
  2. @echo off
  3. perl -S %0.cmd %1 %2 %3 %4 %5 %6 %7 %8 %9
  4. goto endofperl
  5. ';
  6.  
  7. # fixwpps: get semi-conforming PostScript out of WordPerfect 5.0 file
  8. #
  9. # Copyright (C) Angus J. C. Duggan 1991-1995
  10. # See file LICENSE for details.
  11.  
  12. $page = 1;
  13. $nesting = 0;
  14.  
  15. while (<>) {
  16.    s/([^\/]_t)([0-9]+)/\1 \2/g;    # fix wp 5.0 bug
  17.    if (m!/_[be][dp]! || m!_bp \d+ \d+ roll!) {
  18.       print $_;
  19.    } elsif (/^(.*)(_bp.*)$/) {
  20.       print "$1\n" if $1 ne "";
  21.       print "%%Page: $page $page\n";
  22.       print "$2\n";
  23.       $page++;
  24.       $nesting++;
  25.    } elsif (/_ep$/) {
  26.       print $_;
  27.       $nesting--;
  28.    } elsif (/^(.*)(_ed.*)/) {
  29.       print "$1\n" if $1 ne "";
  30.       print "%%Trailer:\n";
  31.       print "$2\n";
  32.    } else {
  33.       print $_;
  34.    }
  35. }
  36. __END__
  37. :endofperl
  38.  
  39.